<?php include('header.php'); ?>
<?php
include("/usr/local/apache2/htdocs/jibaiwang/lib/HomePage.php");
include('log4php/Logger.php');
$cfgfile = "/usr/local/apache2/htdocs/jibaiwang/admin/conf/config.ini";
$defarray = parse_ini_file($cfgfile, 1);
$qlogtag = $defarray["HomePage"]['qlogtag'];
Logger::configure($defarray["HomePage"]['qlogcfg']);
$logger = Logger::getLogger($qlogtag);
$host = $defarray["HomePage"]["host"];
$user = $defarray["HomePage"]["user"];
$pass = $defarray["HomePage"]["pass"];
$db = $defarray["HomePage"]["db"];
$dbh = new Sqlexecutor($host, $user, $pass, $db);
$s = new HomePage($dbh,$logger);
if($_REQUEST["submit"] == "1")
{
    $subject = $_REQUEST["subject"];
    $slogan = $_REQUEST["slogan"];
    $content = $_REQUEST["content"];
    $res = $s->update($subject, $slogan, $content);
}
$list = $s->getInfo();
$home_subject = $list["subject"];
$home_slogan = $list["slogan"];
$home_content = $list["content"];
?>

			<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">系统管理</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">首页信息管理</a>
					</li>
				</ul>
			</div>
	
			<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-edit"></i> 首页信息管理</h2>
<!--
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
-->
					</div>
					<div class="box-content">
						<form class="form-horizontal">
							<fieldset>
							  <div class="control-group">
								<label class="control-label" for="ocusedInput">请输入标题</label>
								<div class="controls">
                                <input class="input-large focused span5" name="subject" style="text-align:center" type="text" value="<?php echo $home_subject;?>">
								</div>
							  </div>
							  <div class="control-group">
								<label class="control-label">请输入口号</label>
								<div class="controls">
                                <input class="input-large focused span5" name="slogan" style="text-align:center" type="text" value="<?php echo $home_slogan;?>">
								</div>
							  </div>
                              <div class="control-group">
								<label class="control-label">请输入正文</label>
								<div class="controls">
								<textarea class="input-xlarge span7" name="content" id="textarea" rows="10"><?php echo $home_content;?></textarea>
                                </div>
							  </div>
							  <div class="form-actions">
								<button value="1" name="submit" type="submit" class="btn btn-primary">保存修改</button>
								<button class="btn">取消修改</button>
							  </div>
							</fieldset>
						  </form>
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
		   
<?php include('footer.php'); ?>
